<template>
  <div class="base-info" v-if="Object.keys(goods).length !== 0">
    <div class="info-title">{{ goods.title }}</div>
    <div class="info-price">
      <span class="n-price">{{ goods.newPrice }}</span>
      <span class="o-price">{{ goods.oldPrice }}</span>
      <!-- <span class="discount" v-if="goods.discount">{{ goods.discount }}</span> -->
    </div>
    <div class="info-other">
      <span>{{ goods.columns[0] }}</span>
      <span>{{ goods.columns[1] }}</span>
      <span>{{ goods.services[goods.services.length - 1].name }}</span>
    </div>
    <div class="info-service">
      <span
        class="info-service-item"
        v-for="index in goods.services.length - 1"
        :key="index"
      >
        <img :src="goods.services[index - 1].icon" alt="" />
        <span>{{ goods.services[index - 1].name }}</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.base-info {
  margin: 10px;
}

.info-title {
  font-size: 16px;
  color: #222;
}

.info-price {
  padding: 15px 0;
}

.info-price .n-price {
  color: #ff5777;
  font-size: 24px;
}

.info-price .o-price {
  color: #999;
  font-size: 13px;
  text-decoration: line-through;
}

.info-other {
  color: #999;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.info-service {
  display: flex;
  justify-content: space-around;
  font-size: 13px;
  padding-top: 20px;
}

.info-service .info-service-item {
  /* display: inline-block; */
  position: relative;
}

.info-service .info-service-item img {
  width: 14px;
  height: 14px;
  position: absolute;
  left: -14px;
}
</style>